package meiriyiti

import "sort"

func partitionArray(nums []int, k int) int {
	sort.Ints(nums)
	ans := 0
	cur := nums[0]
	for _, v := range nums {
		if v-cur > k {
			cur = v
			ans++
		}
	}
	return ans
}
